/**
 * Copyright 2007-2010 非也
 * All rights reserved. 
 * 
 * This library is free software; you can redistribute it and/or modify it under the
 * terms of the GNU Lesser General Public License v3 as published by the Free Software
 * Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License along
 * with this library; if not, see http://www.gnu.org/licenses/lgpl.html.
 *
 */
package org.fireflow2.designer.eclipse.modelwrapper;

import java.beans.PropertyChangeListener;
import java.util.List;

import org.eclipse.core.resources.IProject;

/**
 *
 * @author 非也 nychen2000@163.com
 * Fire Workflow 官方网站：www.firesoa.com 或者 www.fireflow.org
 *
 */
public interface Wrapper {
	// properties
	public static final String ENTERING_TRANSITION = "ENTERING_TRANSITION";
	public static final String ENTERING_LOOP = "ENTERING_LOOP";
	public static final String LEAVING_TRANSITION = "LEAVING_TRANSITION";
	public static final String LEAVING_LOOP = "LEAVING_LOOP";
	public static final String TRANSITION = "TRANSITION";
	public static final String LOOP = "LOOP";
	public static final String ACTIVITY = "ACTIVITY";
	public static final String STARTNODE = "STARTNODE";
	public static final String ENDNODE = "ENDNODE";
	public static final String SYNCHRONIZER = "SYNCHRONIZER";
	public static final String NODE = "NODE";
	public static final String LOCATION = "LOCATION";
	public static final String NAME = "NAME";
	public static final String DISPLAYNAME = "DISPLAYNAME";
	public static final String DIRTY = "DIRTY";
	public static final String EVENT_LISTENER = "EVENT_LISTENER";
	public static final String EXTEND_ATTRIBUTE = "EXTEND_ATTRIBUTE";
	public static final String TASK = "TASK";
	public static final String TASKREF = "TASKREF";
	public static final String DATAFIELD = "DATAFIELD";
	public static final String BENDPOINT = "BENDPOINT";
	public static final String WF_ELEMENT_ATTR = "WF_ELEMENT_ATTR";//
	public static final String LABEL_POSITION = "LABEL_POSITION";


	// simulation properties
	public static final String SIMULATION_PROPERTY_COMPLETED = "SIMULATION_PROPERTY_COMPLETED";
	public static final String SIMULATION_PROPERTY_RUNNING = "SIMULATION_PROPERTY_RUNNING";
	public static final String SIMULATION_PROPERTY_WAITING = "SIMULATION_PROPERTY_WAITING";
	public static final String SIMULATION_PROPERTY_ORIGINAL = "SIMULATION_PROPERTY_ORIGINAL";
	public static final String SIMULATION_PROPERTY_INITIALIZED = "SIMULATION_PROPERTY_INITIALIZED";

	public Wrapper getParent();
	public void setParent(AbsWrapper parent) ;
	public List<Wrapper> getChildren();
	public void addChild(Wrapper child);
	
	public void addChild(Wrapper child,int index);
	/**
	 * 删除child
	 * @param child
	 * @return child在列表中的位置。
	 */
	public int deleteChild(Wrapper child);
	
	/**
	 * 将图形从当前model中移除
	 * @param child
	 */
	public void orphanChild(Wrapper child);
	public void acceptChild(Wrapper child);
	
	public void addPropertyChangeListener(PropertyChangeListener l);
	public void removePropertyChangeListener(PropertyChangeListener l) ;
	
	
	public String getSn();
	public void setName(String name);
	public String getName();
	public String getDisplayName() ;
	public void setDisplayName(String arg0) ;
	public void setDescription(String arg0);
	public String getDescription() ;
	
	public abstract String getElementType();
	
	/**
	 * 在model中缓存Project对象
	 * @return
	 */
	public IProject getProject();
	public void setProject(IProject project);
}
